//
//  IFlyToast.m
//  AEEDemo
//
//  Created by xyzhang on 2021/9/10.
//

#import "IFlyToast.h"

static const NSTimeInterval kToastHideTime = 1.5;

@implementation IFlyToast

+ (void)toast:(NSString *)toastStr onBgView:(UIView *)bgView {
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:bgView animated:YES];
    hud.mode = MBProgressHUDModeText;
    hud.label.text = toastStr;
    
    hud.bezelView.backgroundColor = [UIColor blackColor];
    hud.contentColor = [UIColor whiteColor];
    
    hud.offset = CGPointMake(0.f, 0.f);
    [hud hideAnimated:YES afterDelay:kToastHideTime];
}

@end
